<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/11/9 0009
  Time: 12:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/common/tagPage.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>物流信息列表</title>
    <meta name="keywords" content="中文"/>
    <meta name="description" content="下载"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <!-- basic styles -->

    <link href="${baseurl}statics/assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/font-awesome.min.css"/>

    <!--[if IE 7]>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/font-awesome-ie7.min.css"/>
    <![endif]-->

    <!-- page specific plugin styles -->

    <link rel="stylesheet" href="${baseurl}statics/assets/css/jquery-ui-1.10.3.custom.min.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/chosen.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/datepicker.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/bootstrap-timepicker.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/daterangepicker.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/colorpicker.css"/>

    <!-- fonts -->

    <link rel="stylesheet" href="${baseurl}statics/assets/css/fonts.css"/>

    <!-- ace styles -->

    <link rel="stylesheet" href="${baseurl}statics/assets/css/ace.min.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/ace-rtl.min.css"/>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/ace-skins.min.css"/>

    <!--[if lte IE 8]>
    <link rel="stylesheet" href="${baseurl}statics/assets/css/ace-ie.min.css"/>
    <![endif]-->

    <!-- inline styles related to this page -->

    <!-- ace settings handler -->

    <script src="${baseurl}statics/assets/js/ace-extra.min.js"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <!--[if lt IE 9]>
    <script src="${baseurl}statics/assets/js/html5shiv.js"></script>
    <script src="${baseurl}statics/assets/js/respond.min.js"></script>
    <![endif]-->

    <script type="text/javascript">
        function submitYZ() {
            if ($("#form-field-1").val() == null || $("#form-field-1").val() == "") {
                alert("管理员名称不能为空");
                return false;
            }
            //验证是否选中角色
            if($("#form-field-2").val() == 0){
                alert("请选择角色");
                return false;
            }
            if($("#form-field-2").val() == 1){
                alert("超级管理员只能有一个,不能添加哟");
                return false;
            }
            return true;
        }

    </script>
    <style type="text/css">
        li {
            list-style-type: none;
        }
    </style>

</head>

<body>
<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try {
            ace.settings.check('breadcrumbs', 'fixed')
        } catch (e) {
        }
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="#">订单管理</a>
        </li>

        <li>
            <a href="#">交货列表</a>
        </li>
        <li class="active">物流信息列表</li>
    </ul><!-- .breadcrumb -->

    <div class="nav-search" id="nav-search">


</div>

<div class="page-content1">
    <div class="page-header">
        <h1>
            物流信息列表
            <small>
                <i class="icon-double-angle-right"></i>
                请输入相关信息
            </small>
        </h1>
    </div><!-- /.page-header -->

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" role="form" method="post" action="${baseurl}deliveryOrder/Update"
                  onsubmit="return submitYZ();">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><span style="color: red">*</span>物流信息</label>

                    <div class="col-sm-9">
                         <span>运单号码:${logisticsList.get(0).deliveryOrder.waybillNo}</span><br/>
                         <span>物流跟踪:</span><br/>
                        <ul>
                         <c:forEach items="${logisticsList}" var="logistics">
                             <li>
                             <fmt:formatDate value="${logistics.createTime}"
                                             pattern="YYYY-MM-dd hh:mm:ss"></fmt:formatDate>:&nbsp;&nbsp;${logistics.info}
                             </li>
                         </c:forEach>
                        </ul>
                    </div>
                </div>
                <c:if test="${logisticsList.get(0).deliveryOrder.status != 4}">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"><span style="color: red">*</span>输入物流信息</label>

                    <div class="col-sm-9">
                        <input type="hidden" value="${logisticsList.get(0).deliveryId}" name="deliveryId" id="deliveryIdOld"/>
                        <textarea name="info" cols="60" rows="8" id="infotext"></textarea>
                    </div>
                </div>
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">

                           <input type="checkbox" value="2" name="checkNo"/>已完成交货

                        <button class="btn btn-info" id="infosubmit" type="button">
                            <i class="icon-ok bigger-110"></i>
                            确认
                        </button>
                        <input class="btn btn-info" style="left: 50px;" type="reset"  value="返回" onclick="javascript:history.go(-1)"/>
                    </div>
                </div>
                </c:if>
            </form>


        </div><!-- /.col -->
    </div><!-- /.row -->
</div><!-- /.page-content -->

<!-- basic scripts -->
<!--[if !IE]> -->

<script type="text/javascript">
    window.jQuery || document.write("<script src='${baseurl}statics/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='${baseurl}statics/assets/js/jquery-1.10.2.min.js'>" + "<" + "/script>");
</script>
<![endif]-->

<script type="text/javascript">
    if ("ontouchend" in document) document.write("<script src='${baseurl}statics/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="${baseurl}statics/assets/js/bootstrap.min.js"></script>
<script src="${baseurl}statics/assets/js/typeahead-bs2.min.js"></script>

<!-- page specific plugin scripts -->

<!--[if lte IE 8]>
<script src="${baseurl}statics/assets/js/excanvas.min.js"></script>
<![endif]-->

<script src="${baseurl}statics/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="${baseurl}statics/assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="${baseurl}statics/assets/js/chosen.jquery.min.js"></script>
<script src="${baseurl}statics/assets/js/fuelux/fuelux.spinner.min.js"></script>
<script src="${baseurl}statics/assets/js/date-time/bootstrap-datepicker.min.js"></script>
<script src="${baseurl}statics/assets/js/date-time/bootstrap-timepicker.min.js"></script>
<script src="${baseurl}statics/assets/js/date-time/moment.min.js"></script>
<script src="${baseurl}statics/assets/js/date-time/daterangepicker.min.js"></script>
<script src="${baseurl}statics/assets/js/bootstrap-colorpicker.min.js"></script>
<script src="${baseurl}statics/assets/js/jquery.knob.min.js"></script>
<script src="${baseurl}statics/assets/js/jquery.autosize.min.js"></script>
<script src="${baseurl}statics/assets/js/jquery.inputlimiter.1.3.1.min.js"></script>
<script src="${baseurl}statics/assets/js/jquery.maskedinput.min.js"></script>
<script src="${baseurl}statics/assets/js/bootstrap-tag.min.js"></script>

<!-- ace scripts -->

<script src="${baseurl}statics/assets/js/ace-elements.min.js"></script>
<script src="${baseurl}statics/assets/js/ace.min.js"></script>

<!-- inline scripts related to this page -->

<script type="text/javascript">
    $("#infosubmit").click(function () {
        var id = document.getElementsByName('checkNo');
        var value = new Array();
        for(var i = 0; i < id.length; i++){
            if(id[i].checked){
                value =2;
            }
        }
        if(value == null || value == ""){
           value = 1;
        }
        //异步提交信息
        var infos = $("#infotext").val();
        if(infos == null || infos == ""){
            alert("请输入物流信息")
            return false;
        }
        var deliveryId = $("#deliveryIdOld").val();
        $.ajax({
            url: "${baseurl}deliveryOrder/addLogistics",
            data: {"info":infos,"deliveryId":deliveryId,"checkNo":value},
            type:"post",
            success:function (data) {
                if(data.code=='0'){
                    alert(data.message);
                    location.reload();
                }else{
                    alert(data.message);
                }
            },
            error:function(){
                alert("error");
            }
        });

    });
</script>

</body>
</html>
